#ifndef _CPLANE_H
#define _CPLANE_H
#include <stdlib.h>
#include <stdint.h>
#include <vector>
#include "Common/Event/Event.h"
#include "Common/Timer/ITimer.h"
class Creature;
class PlanePlaneCfgInfo;
//位面
class CPlane :public  IEventExecuteSink, public ITimerHandler
{
public:
	CPlane();
	~CPlane();

	enum enTimeID
	{
		enTimeID_RefreshMonster =1,//刷怪定时器
		enTimeID_Effect			= 10,//效果定时器
	};

	virtual void OnTimer(uint32_t nTimerID);

	virtual void OnExecute(uint16_t nEventID, uint64_t nSrcID, uint8_t bySrcType, void *pContext, int32_t nLen);

	bool Init(uint64_t createrID,uint64_t planeID,uint32_t sceneID,uint32_t teamID);
	bool UnInit();
	bool IsInPlane(uint64_t cid);
	bool AddInPlane(std::vector<uint64_t> & vCid);
	void RemoveInPlane(std::vector<uint64_t> & vCid);
	uint32_t GetPlaneConfigID();
	void SetPlaneConfigID(uint32_t configID);
	std::vector<uint64_t>  GetNoPlayerList();
	std::vector<uint64_t>  GetPlayerList();
	uint64_t GetCreaterID();
	bool LeavePlane(uint64_t cid);
private:
	uint64_t m_planeID;  //位面ID
	uint32_t m_scendID;	 //位面所在的场景ID
	uint32_t m_planeConfigID; //位置配置ID
	uint64_t m_createrID;	//创建者ID
	Creature * m_pCreater;	//创建者对像
	uint32_t m_nTeamID;		//位面组队ID
	const PlanePlaneCfgInfo * m_pConfig;//位面配置
	std::vector<uint64_t> m_vCreatureCid;//位面中的生物ID
	uint32_t m_nRefreshMonsterIndex; //刷怪波数
};



#endif // !_CPLANE_H
